<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//去除前后空格,trim();
			var str1 = "   a   b   c   d   "
			console.log(str1);
			console.log(str1.trim());
			
			//replace()替换
			var str2 = "Today is fine day,today is fine day a!!!"
			console.log(str2);
			console.log(str2.replace(/today/gi,"tomorrow"));
			
			//字符串变数组split();	无参,是把字符串作为一个元素添加进数组中.空字符串,分隔字符串中每一个字符,分别添加进入数组中
			//指定字符分隔数组:特殊符号将不会出现在数组中的任意一个元素中
			var str3 = "关羽|张飞|刘备";
			console.log(str3);
			console.log(str3.split());
			console.log(str3.split(""));
			console.log(str3.split("|"));
		</script>
	</body>
</html>
